class Queue:

    def __init__(self,maxlen=None):
        self.__stack = []
        self.__stack1 = []
        self.maxlen = maxlen

    def pop(self):
        if self.isempty():
            raise "队列为空！！"
        else:
            self.__stack1.append(self.__stack.pop(0))
            return self.__stack1.pop()

    def append(self,data):
        if self.isfull():
            raise "队列已满"
        else:
            self.__stack.append(data)

    def isfull(self):
        if self.maxlen == None:
            return False
        else:
            if len(self.__stack) == self.maxlen:
                return True
            return False
    def isempty(self):
        if len(self.__stack)==0:
            return True
        return False

if __name__ == '__main__':
        d = Queue()
        d.append(1)
        d.append(2)
        print(d.pop())